var app=angular.module("loginapp",[])
 app.controller("loginController",function($scope,$http){
	 
	 $scope.onclickLogin=function(){
		
		 
		// 简单的 GET 请求，可以改为 POST
		 $http({
		     method: 'POST',
		     url: '/life/loginP',
		     params:{email:$scope.email,pwd:$scope.pwd}
		 }).then(function successCallback(response) {
			 
				if("Y"==response.data.result){
		          	
	          		window.location.href="/life/wsq/registerP.html";
	          	}else if(response.data.result=="F"){
	          		$scope.errorMsg="邮箱未验证";
	          		$("#myModal").modal('show');
	          	}else if(response.data.result=="S"){
	          		$scope.errorMsg="密码有误";
	          		$("#myModal").modal('show');
	          		
	          	}else if(response.data.result=="N"){
	          		$scope.errorMsg="邮箱有误";
	          		$("#myModal").modal('show');
	          	}else{
	          		
	          	}
		         // 请求成功执行代码
		     }, function errorCallback(response) {
		         // 请求失败执行代码
		 });
	 }
	 
 })